package com.library;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

import com.library.http.thread.LifeCycleListener;

public class LBaseActivity extends FragmentActivity
{
    
    public LifeCycleListener mListener = null;
    
    @Override
    protected void onCreate(Bundle arg0)
    {
        super.onCreate(arg0);
        if (isNotNull(mListener))
        {
            mListener.onCreate();
        }
    }
    
    @Override
    protected void onDestroy()
    {
        super.onDestroy();
        if (isNotNull(mListener))
        {
            mListener.onDestroy();
        }
        
    }
    
    @Override
    protected void onPause()
    {
        super.onPause();
        if (isNotNull(mListener))
        {
            mListener.onPause();
        }
    }
    
    @Override
    protected void onResume()
    {
        if (isNotNull(mListener))
        {
            mListener.onResume();
        }
        super.onResume();
    }
    
    @Override
    protected void onStart()
    {
        if (isNotNull(mListener))
        {
            mListener.onStart();
        }
        super.onStart();
    }
    
    @Override
    protected void onStop()
    {
        if (isNotNull(mListener))
        {
            mListener.onStop();
        }
        super.onStop();
    }
    
    private boolean isNotNull(Object object)
    {
        return object != null;
    }
    
}
